package sctu.edu.java.year2016.team05.lizixin.day20160605.LianXi;

/**
 * Created by home on 2016/6/5.
 */
public class ChainTest {
    public static void main(String[] args) {

        ChainTest ct=new ChainTest();
            try{
                ct.test2();

            }catch (Exception  e){e.printStackTrace();}

    }
    public void test1() throws DrunkException{
        throw new DrunkException("别喝酒");
    }
    public void test2(){
        try {
            test1();
        }catch (DrunkException e ){
            RuntimeException newEXC=new RuntimeException("挺抽象的");
            newEXC.initCause(e);
            throw newEXC;
        }
    }
}
